<template>
	<view>
		<view class="box" v-for="(item,index) in newsData" :key='item.id' @click='enterDetail(item.id)'>
			<image :src="item.img_url" mode=""></image>
			<view class="right">
				<view class="top">
					{{item.title}}
				</view>
				<view class="bottom">
					<text>发表时间:	{{item.add_time | formatDate}}</text>
					<text>浏览:	{{item.click}}次</text>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		props: ['newsData'],
		methods:{
			enterDetail(id){
				this.$emit('enter',id)
			}
		}
	}
</script>

<style lang="less" scoped>
	.box {
		display: flex;
		height: 150rpx;
border-bottom: 1px solid #b50e03;
		// width: 100%;
		image {
			height: 150rpx;
			width: 200rpx;

		}

		.right {
			width: 550rpx;
			height: 100%;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			box-sizing: border-box;
			padding: 10rpx 10rpx 15rpx 20rpx;

			.top {
				font-size: 30rpx;
			}

			.bottom {
				font-size: 25rpx;
				text:nth-child(2){
					margin-left: 10px;
					}
			}

		}
	}
</style>
